//
//  TipLayer.swift
//  MyColorPicker
//
//  Created by 火星人 on 2018/9/20.
//  Copyright © 2018年 火星人. All rights reserved.
//

import Cocoa

class TipLayer: CALayer {
    var image: CGImage!
    var r = CGFloat(0)
    var point = NSPoint.zero
    var halfW = CGFloat(20)
    var size = CGSize(width: 40, height: 40)
    
    override func draw(in ctx: CGContext) {
        if let image = image.cropping(to: CGRect(origin: point, size: self.size)) {
            ctx.draw(image, in: self.bounds)
        }
    }
}
